package FileDemo;

import java.io.File;
import java.io.IOException;

/**
 * @Description
 * @Author:PrinceHan
 * @CreateTime:2021/10/20 23:15
 */
public class FileCteate {
    public static void main(String[] args) throws IOException {
        File file1 = new File("E:\\Java-IDEA\\FileTest");
        file1.createNewFile();
        System.out.println(file1.delete());
//                System.out.println(file1.createNewFile());
//        System.out.println(file1.isFile());
//        System.out.println(file1.getParent());
        File file2 = new File("E:\\Java-IDEA\\FileTest1");
        file2.mkdir();
        File file3 = new File("E:\\Java-IDEA\\FileTest\\test1");
        file3.mkdirs();

//        System.out.println(file2.delete());
//        System.out.println(file3.delete());
        File file = new File("E:\\Java-IDEA");
        String[] strarr = file.list();
        for(String str: strarr) {
            System.out.println(str);
        }
        File[] files = file.listFiles();
        for(File file_: files) {
            System.out.println(file_.getName());
        }

         System.out.println(file1.getAbsolutePath());
         System.out.println(file1.getPath());
         System.out.println(file3.isDirectory());
         System.out.println(file1.exists());

    }
}
